﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SS.GoogleTranslation;

namespace Dictionary.Core
{
    public class Translate
    {
        public String from { get; set; }
        public String to { get; set; }
        public String text { get; set; }

        public Translate()
        { }
        public Translate(String from, String to, String text)
        {
            this.from = from;
            this.to = to;
            this.text = text;
        }
        public String toTranslate()
        {
            GoogleTranslator ssTranslate = new GoogleTranslator();
            string TranslatedText = ssTranslate.TranslateText(this.text,this.from,this.to);
            return TranslatedText;
        }

        public static String[] getLanguages()
        {
            return GoogleTranslator.Languages.ToArray();
        }
    }
}
